﻿using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Text;

namespace Yammu.Core.MediaManagement
{
    /// <summary>
    /// Provides access to all media items. The root item is the starting point from which all media items can be synched.
    /// @tbd TO THINK: can we use device sync to sync to other yammu collections
    /// </summary>
    [InheritedExport(typeof(IMediaCollection))]
    //[PartCreationPolicy(CreationPolicy.Shared)]
    public interface IMediaCollection 
    {
        /// <summary>
        /// Returns list of all files in media collection irrespective of the directory the belong to
        /// </summary>
        IList<IMediaFile> Files { get; }

        /// <summary>
        /// Returns the root directory of the media collection. This is used to divide the items in the collection into
        /// </summary>
        IMediaDir GetRootDir { get; }

        /// <summary>
        /// Returns list of items with a specific attribute
        /// </summary>
        /// <param name="attrName"></param>
        /// <param name="attrValue"></param>
        /// <returns></returns>
        IList<IMediaFile> GetByAttribute(string attrName, string attrValue);

        /// <summary>
        /// Returns the count of the items in the collection
        /// </summary>
        long Count { get; }

        /// <summary>
        /// Adds the given item to the collection. The directory of the media item is determine using the Path property of the file.
        /// </summary>
        /// <param name="file"></param>
        void AddItem(IMediaItem file);

       
        /// <summary>
        /// Remove the given item from the collection. FullPath is used to uniquely identify the file within the collectin.
        /// </summary>
        /// <param name="file"></param>
        void RemoveItem(IMediaItem file);
    }
}
